package com.goldcn.order.dao;

import com.goldcn.order.dto.SettlementConditionDto;
import com.goldcn.order.dto.SettlementForCountDto;
import com.goldcn.order.model.CommissionSettlement;
import com.goldcn.order.vo.SettlementCountVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface CommissionSettlementMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CommissionSettlement record);

    int insertSelective(CommissionSettlement record);

    CommissionSettlement selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CommissionSettlement record);

    int updateByPrimaryKey(CommissionSettlement record);

    List<CommissionSettlement> selectByYearMonth(Map<String, Object> param);

    int insertBatch(List<CommissionSettlement> params);

    List<CommissionSettlement> selectByConditon(SettlementConditionDto settlement);

    int updateState(Map params);

    BigDecimal settlementTotal(@Param("sellerID") Long sellerID, @Param(value = "companyID") Long companyID);

    BigDecimal selectTotalCommission(@Param("branchID") Long branchID, @Param(value = "companyID") Long companyID);

    SettlementCountVo selectSettlementCount(SettlementForCountDto countDto);

    List<Map<String, Integer>> selectDistinctByState(@Param("type") String type, @Param(value = "companyID") Long companyID);

    int deleteByMonthRecord(@Param("year") Integer year, @Param("month") Integer month);

    List<SettlementCountVo> selectSettlementSum(SettlementForCountDto param);
}